package top.tenebrous.termbor.rpc.provider;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import top.tenebrous.termbor.rpc.provider.common.RpcServiceScanner;
import top.tenebrous.termbor.rpc.provider.server.BaseService;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @program: termbor-rpc
 * @description:
 * @author: yazhang6
 * @create: 2024-05-21 08:51
 **/
public class RpcSingleManger extends BaseService {

    private final Logger logger = LoggerFactory.getLogger(RpcSingleManger.class);

    public RpcSingleManger(String serverAddress,  String registryAddress, String registryType, String registryLoadBalanceType, String scanPackage, String reflectType) {
        super(serverAddress, registryAddress, registryType,registryLoadBalanceType, reflectType);
        try {
            super.handlerMap = RpcServiceScanner.doScannerWithRpcServiceAnnotationFilterAndRegistryService(this.host, this.port, scanPackage, registryService);
        } catch (Exception e) {
            logger.error("rpc server init error", e);
        }
    }

}
